#if !defined(FAKE_FRAMEWORK_H)
#define FAKE_FRAMEWORK_H

#include "Framework.h"
#include <stdexcept>
#include <rt/Exceptions/COMException.h>

class FakeFramework : public MandelShader::IFramework
{
public:
	FakeFramework()
		: GetRenderTargetViewCalled(false),
		GetRenderTargetViewFakeResult(0),
		GetDepthStencilViewCalled(false),
		GetDepthStencilViewFakeResult(0),
		FindMediaCalled(false),
		FindMediaLastFileName(),
		FindMediaFakeResult(),
		FindMediaFakeThrowHResult(S_OK),
		CompileFromFileCalled(false),
		CompileFromFileLastFile(),
		CompileFromFileLastShaderFlags(0U),
		CompileFromFileLastEntryPoint(),
		CompileFromFileLastProfile(),
		CompileFromFileFakeErrors(0),
		CompileFromFileFakeResult(0),
		CompileFromFileFakeHResult(E_FAIL),
		DisplayCompileErrorMessageCalled(false),
		DisplayCompileErrorMessageLastMessage()
	{
	}
	virtual ~FakeFramework() { }

	virtual ID3D11RenderTargetView *GetRenderTargetView()
	{
		GetRenderTargetViewCalled = true;
		return GetRenderTargetViewFakeResult;
	}
	bool GetRenderTargetViewCalled;
	ID3D11RenderTargetView *GetRenderTargetViewFakeResult;

	virtual ID3D11DepthStencilView *GetDepthStencilView()
	{
		GetDepthStencilViewCalled = true;
		return GetDepthStencilViewFakeResult;
	}
	bool GetDepthStencilViewCalled;
	ID3D11DepthStencilView *GetDepthStencilViewFakeResult;

	virtual rt::tstring FindMedia(rt::tstring const &fileName)
	{
		FindMediaCalled = true;
		FindMediaLastFileName = fileName;
		THR(FindMediaFakeThrowHResult);
		return FindMediaFakeResult;
	}
	bool FindMediaCalled;
	rt::tstring FindMediaLastFileName;
	rt::tstring FindMediaFakeResult;
	HRESULT FindMediaFakeThrowHResult;

	virtual HRESULT CompileFromFile(rt::tstring const &file, DWORD shaderFlags,
		std::string const &entryPoint, std::string const &profile,
		ID3D10Blob **shader, ID3D10Blob **errors)
	{
		CompileFromFileCalled = true;
		CompileFromFileLastFile = file;
		CompileFromFileLastShaderFlags = shaderFlags;
		CompileFromFileLastEntryPoint = entryPoint;
		CompileFromFileLastProfile = profile;
		*errors = CompileFromFileFakeErrors;
		*shader = CompileFromFileFakeResult;
		return CompileFromFileFakeHResult;
	}
	bool CompileFromFileCalled;
	rt::tstring CompileFromFileLastFile;
	DWORD CompileFromFileLastShaderFlags;
	std::string CompileFromFileLastEntryPoint;
	std::string CompileFromFileLastProfile;
	ID3D10Blob *CompileFromFileFakeErrors;
	ID3D10Blob *CompileFromFileFakeResult;
	HRESULT CompileFromFileFakeHResult;

	virtual void DisplayCompileErrorMessage(char const *message)
	{
		DisplayCompileErrorMessageCalled = true;
		DisplayCompileErrorMessageLastMessage = message;
	}
	bool DisplayCompileErrorMessageCalled;
	std::string DisplayCompileErrorMessageLastMessage;
};

#endif
